This invention has an object to improve U.S. Pat. No. 4,820,330 and U.S. patent application Ser. No. 07/469,017, U.S. Pat. No. 5,010,752 having the same title as this invention, supplying an electronic lock having wider adaptability by unlocking not only with a coded number card but also with a key.